package com.szms.mobile.me;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.szms.mobile.BaseFragment;
import com.szms.mobile.MainActivity;
import com.szms.mobile.R;
import com.szms.mobile.listeners.AddFragmentListener;
import com.szms.mobile.util.MenuUtils;

/**
 * A simple {@link Fragment} subclass.
 * create an instance of this fragment.
 */
public class MeFragment extends BaseFragment {


    public MeFragment(MainActivity _activity){
        super(_activity,true);
    }


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_me, container, false);

    }

    /**
     * 重新回来
     */
    @Override
    public void onResume() {
        super.onResume();

        //todo 判断是否是已登录状态

        TextView btnSetting = activity.findViewById(R.id.btnSetting);
        btnSetting.setOnClickListener(new AddFragmentListener(new SystemFragment(activity), MenuUtils.Instance().getMap(),activity));

        TextView btnLogin = activity.findViewById(R.id.btnLogin);
        btnLogin.setOnClickListener(new AddFragmentListener(new LoginFragment(activity),MenuUtils.Instance().getMap(),activity));

        TextView btnLogout = activity.findViewById(R.id.btnLogout);


    }
}